package debtbundler.domain.entity.impl;


import static org.junit.Assert.*;

import org.junit.After;
import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.Test;

import debtbundler.domain.entity.Transaction;

public class TransactionTest {
	
	@BeforeClass 
	public static void enableLogging() {
		debtbundler.logging.ConfigurationReader.setDefaultConf();
	}

	@Before
	public void setUp() throws Exception {
	}

	@After
	public void tearDown() throws Exception {
	}
	
	@Test(expected=IllegalArgumentException.class)
	public void testNegativeValue() {
		Transaction tr = EntityManager.createPayment(EntityManager.createPerson(), EntityManager.createSharedCost());
		tr.setValue(-1);
		fail("Transaction cannot have negative value");
	}

}
